const { defineConfig } = require("@vue/cli-service");
const path = require("path");
const resolve = (dir) => path.join(__dirname, dir);
module.exports = defineConfig({
  // //路径前缀
  publicPath: "/geci",
  assetsDir: "assets",
  transpileDependencies: true,
  productionSourceMap: false,
  configureWebpack: {
    resolve: {
      alias: {
        "@": resolve("src"),
      },
    },

    // externals: {
    //   vue: "Vue",
    //   "vue-router": "VueRouter",
    //   vuex: "Vuex",
    //   axios: "axios",
    //   "element-ui": "ELEMENT",
    // },
  },
  css: {
    extract: { ignoreOrder: true },
    loaderOptions: {
      scss: {
        additionalData: '@import "@/styles/global.scss";',
      },
    },
  },
  devServer: {
    client: {
      overlay: false,
    },
    hot: true, // 开启热更新
    port: 9000,
    open: true, // 自动打开
    proxy: {
      "/admin-api": {
        // target: "http://10.0.48.7",
        target: "http://8.138.94.207:48080/admin-api", //映射
        // target: "http://192.168.100.89:18888/api", //开发环境
        // target: "http://192.168.100.94:18888/api", //sit测试环境
        // target: "http://10.0.94.36:18888/api", //uat测试环境
        // target: "http://prod.mes.trio.com/api", //生产环境
        ws: true,
        pathRewrite: {
          "^/admin-api": "/",
        },
      },
    },
  },
});
